﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
using UnityEngine.Events;

namespace Elvex
{
    // ui资产配置
    public class UIAssetConfigure
    {
        public object ID { get; set; }

        public string AssetPath { get; set; }

        public Type[] Components { get; set; }
    }

    public class UIHintConfigure
    {
        // 提示ID
        // 显示类型
        // 检查函数
        public object HintID { get; private set; }

        public System.Func<int> CheckFunc { get; private set; }

    }

    public class UIPanelConfigure
    {
        #region
        Dictionary<string, UIHintConfigure> m_hintConfigs = new Dictionary<string, UIHintConfigure>();

        public ReadOnlyDictionary<string, UIHintConfigure> HintConfigures { get; }

        public UIPanelConfigure()
        {
            HintConfigures = new ReadOnlyDictionary<string, UIHintConfigure>(m_hintConfigs);
        }
        #endregion
    }


    // UI配置数据
    public class UIConfigure
    {
        // 界面配置
        Dictionary<object, UIPanelConfigure> m_panelConfigs = new Dictionary<object, UIPanelConfigure>();

        // 资源配置
        internal Dictionary<object, UIAssetConfigure> AssetsConfigurations = new Dictionary<object, UIAssetConfigure>();

        // 消息提示间隔
        internal float MessageTipInterval { get; set; } = 0.3f;

        // 消息框资源
        
        public ReadOnlyDictionary<object, UIPanelConfigure> PanelConfigures { get; }

        public UIConfigure()
        {
            PanelConfigures = new ReadOnlyDictionary<object, UIPanelConfigure>(m_panelConfigs);
        }
    }
}
